package com.heima.comment.controller.v1;

import com.heima.comment.dtos.CommentRepayDTO;
import com.heima.comment.dtos.CommentRepayLikeDTO;
import com.heima.comment.dtos.CommentRepaySaveDTO;
import com.heima.comment.dtos.CommentSaveDTO;
import com.heima.comment.service.CommentRepayService;
import com.heima.comment.service.CommentService;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "评论文章接口",value = "评论文章接口")
@RestController
@RequestMapping("/api/v1/comment_repay")
public class CommentRepayController {

    @Autowired
    private CommentRepayService commentRepayService;
    @ApiOperation(value = "加载回复评论列表",notes = "加载回复评论列表")
    @PostMapping("/load")
    public ResponseResult loadCommentRepay(@RequestBody CommentRepayDTO dto) {
        return commentRepayService.loadCommentRepay(dto );
    }


    @ApiOperation(value = "保存对评论的回复",notes = "保存对评论的回复")
    @PostMapping("/save")
    public ResponseResult saveCommentRepay(@RequestBody CommentRepaySaveDTO dto) {
        return commentRepayService.saveCommentRepay(dto );
    }


    @ApiOperation(value = "点赞回复的评论",notes = "点赞回复的评论")
    @PostMapping("/like")
    public ResponseResult saveCommentRepayLike(@RequestBody CommentRepayLikeDTO dto) {
        return commentRepayService.saveCommentRepayLike(dto );
    }
}
